package cn.lingyangwl.agile.msg.push;

import cn.lingyangwl.agile.msg.push.core.channel.client.*;
import cn.lingyangwl.agile.tenant.core.*;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Arrays;

/**
 * @author shenguangyang
 */
@Component
public class MsgPushRunner implements ApplicationRunner {
    @Resource
    private TenantDataIsolateService dataIsolateService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        BaseMsgChannelClient.initMsgChannel();
        Arrays.stream(TenantDataType.values()).forEach(dataIsolateService::addDataType);
    }
}
